﻿using System;
using System.IO;
using System.Security;

class ReadAFile
{
    static void Main()
    {
        try
        {
            string file = File.ReadAllText("C:\\WINDOWS\\win.ini");
            Console.WriteLine(file);
        }
        catch (FileNotFoundException)
        {
            Console.WriteLine("Cannot find this file");
        }
        catch (DirectoryNotFoundException)
        {
            Console.WriteLine("Invalid Folder ");
        }
        catch (PathTooLongException)
        {
            Console.WriteLine("The path is too long");
        }
        catch (UnauthorizedAccessException)
        {
            Console.WriteLine("You don`t have access!");
        }
        catch (NotSupportedException)
        {
            Console.WriteLine("Cannot open this file!");
        }
        catch (SecurityException)
        {
            Console.WriteLine("Not enough permission to open file!");
        }
    }
}